package cn.webrx;

import java.util.*;

public class Iterrator1 {
    public static void main(String[] args) {
        Set<String> set = new HashSet<>(List.of("java", "php", "javascript"));
        System.out.println(set);


        Iterator<String> it = set.iterator();
        System.out.println(set);
        while (it.hasNext()) {
            it.next();
            //if (t.startsWith("java")) {
                it.remove();
            //}
            //System.out.println(t);
        }

        System.out.println(set);

        for (; it.hasNext(); ) {
            System.out.println(it.next());
        }

    }
}
